package com.glory.dmegcpda.model

import com.glory.dmegcpda.base.Constant
import com.glory.dmegcpda.bean.LoginBean
import com.google.gson.JsonObject
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toResponse


class LoginRepository : BaseRepository(){
    suspend fun login(bodyMap: JsonObject): LoginBean {
        return RxHttp.postForm(Constant.mainUrl)
            .addAll(getInJsonData(bodyMap,"SYS.USER_LOGIN"))
            .toResponse<LoginBean>()
            .await()
    }

}